﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace Class_KetNoi
{
   public class KetNoi_ChucVu:KetNoiCoSoDuLieu
    {
       public void them_ChucVu(string @TenChucVu, string @LuongCoBan)
       {
           SqlCommand cmd = new SqlCommand("dbo.insert_ChucVu", cnn);
           cmd.CommandType = CommandType.StoredProcedure;

           SqlParameter p = new SqlParameter("@TenChucVu", TenChucVu);
           cmd.Parameters.Add(p);
           p = new SqlParameter("@LuongCoBan",Convert.ToDouble (LuongCoBan));
           cmd.Parameters.Add(p);
           cmd.ExecuteNonQuery();
       }
       public void sua_ChucVu(string @MaCV, string @TenChucVu, string @LuongCoBan)
       {
           SqlCommand cmd = new SqlCommand("dbo.update_ChucVu", cnn);
           cmd.CommandType = CommandType.StoredProcedure;
           SqlParameter p = new SqlParameter("@MaCV",MaCV);
           cmd.Parameters.Add(p);
           p = new SqlParameter("@TenChucVu", TenChucVu);
           cmd.Parameters.Add(p);
           p = new SqlParameter("@LuongCoBan",Convert.ToDouble( LuongCoBan));
           cmd.Parameters.Add(p);
           cmd.ExecuteNonQuery();
       }
       public void xoa_ChucVu(string @MaCV)
       {
           SqlCommand cmd = new SqlCommand("dbo.delete_ChucVu", cnn);
           cmd.CommandType = CommandType.StoredProcedure;
           SqlParameter p = new SqlParameter("@MaCV",MaCV);
           cmd.Parameters.Add(p);
           cmd.ExecuteNonQuery();
       }
    }
}
